package com._1.message.elasticsearch;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

@Document(indexName = "product_info")
@Data
public class ProductInfo {

    @Id
    private Integer id;

    @Field(type = FieldType.Text)
    private String productName;

    @Field(type = FieldType.Text)
    @JsonProperty("annual_rate")
    private String annual_rate;

    @Field(type = FieldType.Text)
    private String describe;

    @Override
    public String toString() {
        return "ProductInfo{" +
                "id='" + id + '\'' +
                ", productName='" + productName + '\'' +
                ", annualRate='" + annual_rate + '\'' +
                ", describe='" + describe + '\'' +
                '}';
    }

}
